package apiday04homework;

import java.io.File;

public class DeleterFileDemo {
    public static void main(String[] args) {
        /*
        File file = new File("test.txt");
        if (file.exists()) {
            file.delete();
            System.out.println("文件已经删除");
        }
        else{
            System.out.println("文件不存在");
        }

         */
        File file = new File("test.txt");
        if (file.exists()) {
            file.delete();
            System.out.println("文件已经删除");
        }else {
            System.out.println("文件不存在");
        }
    }
}
